package com.atelier.plugin.projectWizard.data;


import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author tangrufei
 * @date 2023-05-16 15:33
 */
@State(name = "DataSetting",storages = @Storage("plugin.xml"))
public class DataSetting implements PersistentStateComponent<ProjectConfig> {
    private ProjectConfig projectConfig=new ProjectConfig();
    public static DataSetting getInstance(){
        return ServiceManager.getService(DataSetting.class);
    }
    @Override

    public @Nullable ProjectConfig getState() {
        return projectConfig;
    }

    @Override
    public void loadState(@NotNull ProjectConfig state) {
        this.projectConfig=state;
    }
}
